
<script>
    var status_list = {0:'隐藏[仅开发者可见]',1:'正式[玩家正常游戏]',2:'维护[玩家可见但不可进入]',9:'草稿[任何人看不到]'};
    var online_list = {0:'流畅',1:'火爆',2:'爆满[禁止注册]'};
    var defaultAfterShowForm = function(e,edit){
        // if(!edit){
        //     return;
        // }
        var status = $("#status").val();
        if (status != 2) {
            // $("#status option[value='0']").remove();
            $("#tip").hide();
        }
        else{
            $("#tip").show();
        }

    }
    var option = {
        colModel : [
            {label: 'sid', name: '_id', width: 80,key:true, editable: true,sortable:true, resize:false,search:true,fixed:true,
                editrules:{required:true,number:true,minValue:1,maxValue:9999},
            },

            {label: '名称', name: 'name',width: 180, editable: true, sortable:false,hidden:false,resize:true,fixed:true,search:false},

            {label: '开服时间', name: 'time',width: 180, editable: true, sortable:false,hidden:false,resize:true,fixed:true,search:false,
                formatter:cosjs.jqgrid.timeFormat,
                formoptions:{ elmsuffix: ' 开服后不能修改' },
                editoptions:{ dataInit: cosjs.jqgrid.timeMask},
            },

            {label: '状态', name: 'status',width: 120, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:true,
                formatter:'select', edittype:'select', editoptions:{value:status_list},
                stype:"select",
                searchoptions:{value:status_list}
            },
            {label: '人数', name: 'online',width: 120, editable: true, sortable:false,hidden:false,resize:false,fixed:true,search:true,
                formatter:'select', edittype:'select', editoptions:{value:online_list},
                stype:"select",
                searchoptions:{value:online_list}
            },

            {label: '内网地址', name: 'local',width: 180, editable: true,sortable:false, resize:true,search:false,fixed:true,search:false},
            {label: '外网地址', name: 'remote',width: 300, editable: true,sortable:false, resize:true,search:false,fixed:false,search:false},
        ],

        afterShowAddForm : function(e){
            defaultAfterShowForm(e,0);
        },
        afterShowEditForm : function(e){
            defaultAfterShowForm(e,1);
        },
    }
    $(document).ready(function () {
        cosjs_create_jqgrid(option);
    });
</script>
sid为900以上的区服为特殊区服

